import request from './apis'
//Back pay. Run
enum Api {
    equipments = '/unit/PublicShow/pcIndex', //联网设备
    equipments_options = 'unit/DeviceBase/moldTree', //联网设备类型
    earlyWarning = '/unit/PatrolPosition/statusCount', //don't know anything,shit mountain code
    thingWarning = '/unit/PublicShow/pcIndexIOT',
    pcIndexIOTList = '/unit/PublicShow/pcIndexIOTList',
    pcIndexIOTExport = '/unit/PublicShow/pcIndexIOTExport',
    zhiban = '/unit/WatchUser/lists',
    zhibanNow = '/unit/WatchUser/dateLists',
    zhibanAddOrUpdate = '/unit/WatchUser/edits',
    zhibanAddOrUpdate2 = '/unit/WatchUser/addUserV2',
    zhibanDel = '/unit/WatchUser/deleteById',
    zhibanDels = '/unit/WatchUser/deletes',
    getFireSearch = '/unit/PublicShow/learningRecordV2', //消防查询
    getFireSearchExcl = '/unit/PublicShow/learningRecordV2Excl', //消防查询
    study = '/unit/PublicShow/learningRecord',
    shanghudefen = '/unit/PublicShow/subUnitScoreList',
    shanghudefenExcel = '/unit/PublicShow/deriveScoreList',
    yinhuanzhenggai = '/unit/PublicShow/pcIndexDefectTreatment',
    editRoom = '/unit/WatchUser/editRoom',
    roomInfo = '/unit/WatchUser/roomInfo',
    learningRecordExcl = '/unit/PublicShow/learningRecordExcl?type=100',
    organization = '/unit/UnitDuty/setStructure',
    getOrganization = 'unit/UnitDuty/getStructure',
    zhibanInfo = '/unit/WatchUser/info',
    studyList = '/unit/SubScore/studyList',
    patrolList = '/unit/SubScore/patrol',
    subInfo = '/unit/SubScore/subInfo',
    activityList = '/unit/SubScore/activityList',
    closeInfo = '/unit/SubScore/closeInfo',
    fireInfo = '/unit/SubScore/fireInfo',
    flueInfo = '/unit/SubScore/flueInfo',
    scoreLog = '/unit/PublicShow/scoreLogList',
    scoreLogListDerive = '/unit/PublicShow/scoreLogListDerive'
}

// 安全得分导出
export const scoreLogListDerive = (data) => {
    return request.post(Api.scoreLogListDerive, data, {
        responseType: 'blob'
    })
}


// 安全得分
export const scoreLog = (data) => {
    return request.post(Api.scoreLog, data)
}

// 烟道
export const flueInfo = (data) => {
    return request.post(Api.flueInfo, data)
}

// 动火动电
export const fireInfo = (data) => {
    return request.post(Api.fireInfo, data)
}

//三关一闭
export const closeInfo = (data) => {
    return request.post(Api.closeInfo, data)
}

// 消防培训和火灾演练
export const activityList = (data) => {
    return request.post(Api.activityList, data)
}

// 子商户详情
export const subInfo = (data) => {
    return request.post(Api.subInfo, data)
}

// 子商户得分巡查
export const patrolList = (data) => {
    return request.post(Api.patrolList, data)
}

export const studyList = (data) => {
    return request.post(Api.studyList, data)
}

export const equipments = (params) => {
    return request.get(Api.equipments, { params })
}

export const equipmentsOptions = () => {
    return request.get(Api.equipments_options)
}
export const earlyWarning = () => {
    return request.get(Api.earlyWarning)
}

export const thingWarning = () => {
    return request.post(Api.thingWarning)
}
export const zhiban = (data) => {
    return request.post(Api.zhiban, data)
}
export const zhibanNow = () => {
    return request.get(Api.zhibanNow)
}
export const zhibanAddOrUpdate = (data) => {
    return request.post(Api.zhibanAddOrUpdate, data)
}
export const zhibanAddOrUpdate2 = (data) => {
    return request.post(Api.zhibanAddOrUpdate2, data)
}
export const getFireSearch = (data) => {
    return request.post(Api.getFireSearch, data)
}
export const getStudy = (params) => {
    return request.get(Api.study, { params })
}

export const zhibanDel = (data) => {
    return request.post(Api.zhibanDel, data)
}

export const zhibanDels = (data) => {
    return request.post(Api.zhibanDels, data)
}

export const zhibanInfo = (data) => {
    return request.post(Api.zhibanInfo, data)
}

export const shanghudefen = (data) => {
    return request.post(Api.shanghudefen, data)
}

export const shanghudefenExcel = (data) => {
    return request.post(Api.shanghudefenExcel, data, {
        responseType: 'blob'
    })
}

export const yinhuanzhenggai = (data?) => {
    return request.post(Api.yinhuanzhenggai, data)
}
export const getFireSearchExcl = (data) => {
    return request.post(Api.getFireSearchExcl, data, {
        responseType: 'blob'
    })
}
export const editRoom = (data?) => {
    return request.post(Api.editRoom, data)
}
export const roomInfo = (data?) => {
    return request.post(Api.roomInfo, data)
}

export const pcIndexIOTList = (params) => {
    return request.get(Api.pcIndexIOTList, { params })
}
export const learningRecordExcl = (data) => {
    return request.post(Api.learningRecordExcl, data, {
        responseType: 'blob'
    })
}
export const pcIndexIOTExport = (params) => {
    return request.get(Api.pcIndexIOTExport, {
        params,
        responseType: 'blob'
    })
}

export const organization = (data) => {
    return request.post(Api.organization, data)
}

export const getOrganization = () => {
    return request.post(Api.getOrganization)
}
